package io.gitee.devaper.starlight.module.room.entity.param

import io.gitee.devaper.starlight.module.room.constant.*
import jakarta.validation.constraints.Max
import jakarta.validation.constraints.Min
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Pattern

/**
 * 创建房间需要提供的参数
 */
data class CreateRoomParam(

    /**
     * 房间名称
     */
    @field:NotNull(message = "{$MS_ROOM_VALIDATION_NAME_REQUIRES}")
    @field:Pattern(regexp = ROOM_NAME_PATTERN, message = "{$MS_ROOM_VALIDATION_NAME_FORMAT_MISMATCH}")
    val name: String,

    /**
     * 房间密码
     */
    @field:Pattern(regexp = ROOM_PASSWORD_PATTERN, message = "{$MS_ROOM_VALIDATION_PASSWORD_FORMAT_MISMATCH}")
    val password: String?,

    /**
     * 房间容量
     */
    @field:Min(ROOM_CAPACITY_RAGE_MIN, message = "{$MS_ROOM_VALIDATION_CAPACITY_RAGE_MISMATCH}")
    @field:Max(ROOM_CAPACITY_RAGE_MAX, message = "{$MS_ROOM_VALIDATION_CAPACITY_RAGE_MISMATCH}")
    val capacity: Int

)